home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 September / PCWorld_2004-09_cd.bin / software / topware / winamp / winamp504_full.exe / $R0 / Winamp Modern / attribs.m < prev    next >
Text File  |  2004-07-01  |  12KB  |  301 lines

  1. #ifndef included
  2. #error This script can only be compiled as a #include
  3. #endif
  4.  
  5. #ifndef __ATTRIBS_M
  6. #define __ATTRIBS_M
  7.  
  8. #include <lib/config.mi>
  9.  
  10. // -----------------------------------------------------------------------------------------------------------------
  11.  
  12. // this is the page that maps its items to the options menu, you can add attribs or more pages (submenus)
  13. #define CUSTOM_OPTIONSMENU_ITEMS "{1828D28F-78DD-4647-8532-EBA504B8FC04}"
  14.  
  15. // this is the page that maps its items to the windows menu (aka View), you can add attribs or more pages (submenus)
  16. #define CUSTOM_WINDOWSMENU_ITEMS "{6559CA61-7EB2-4415-A8A9-A2AEEF762B7F}"
  17.  
  18. // custom options submenu item page, you can add more, just use guidgen and Config.newItem()
  19. #define CUSTOM_PAGE "{26E26319-AECA-4433-B8F1-F4A5BF2A9ED5}"
  20.  
  21. // drawer config page
  22. #define CUSTOM_PAGE_DRAWER "{C338B30F-2A04-4b10-871F-4E9D52D62806}"
  23.  
  24. // menubars config page
  25. #define CUSTOM_PAGE_MENUBARS "{12ED320E-6813-45ac-9F8E-78EE5B2B5F6D}"
  26.  
  27. // main windowshade config page
  28. #define CUSTOM_PAGE_WINDOWSHADE "{58F07E21-AE96-4899-B7BC-3640B40029FB}"
  29.  
  30. // vis button config page
  31. #define CUSTOM_PAGE_VISCMD "{D70E3ABF-D2FF-4b82-9A70-4B5DF1A5D942}"
  32.  
  33. // notifier config page
  34. #define CUSTOM_PAGE_NOTIFIER "{1AB968B3-8687-4a35-BA70-FCF6D92FB57F}"
  35.  
  36. // songticker config page
  37. #define CUSTOM_PAGE_SONGTICKER "{7061FDE0-0E12-11D8-BB41-0050DA442EF3}"
  38.  
  39. // non exposed attribs page
  40. #define CUSTOM_PAGE_NONEXPOSED "{E9C2D926-53CA-400f-9A4D-85E31755A4CF}"
  41.  
  42.  
  43. // -----------------------------------------------------------------------------------------------------------------
  44.  
  45. Function initAttribs();
  46.  
  47. // -----------------------------------------------------------------------------------------------------------------
  48.  
  49. Global ConfigAttribute scrolldrawerattrib;
  50. Global ConfigAttribute scrollconfigdrawerattrib;
  51.  
  52. Global ConfigAttribute vis_detach_attrib;
  53. Global ConfigAttribute video_detach_attrib;
  54.  
  55. Global ConfigAttribute drawer_directiontop_attrib;
  56. Global ConfigAttribute drawer_directionbottom_attrib;
  57. Global ConfigAttribute drawer_directionbypass_attrib;
  58.  
  59. Global ConfigAttribute eq_visible_attrib;
  60.  
  61. Global ConfigAttribute menubar_main_attrib;
  62. Global ConfigAttribute menubar_pe_attrib;
  63. Global ConfigAttribute menubar_ml_attrib;
  64.  
  65. Global ConfigAttribute windowshade_linkall_attrib;
  66. Global ConfigAttribute windowshade_linkposition_attrib;
  67. Global ConfigAttribute windowshade_linknone_attrib;
  68.  
  69. Global ConfigAttribute beatvisualization_attrib;
  70.  
  71. Global ConfigAttribute viscmd_config_attrib;
  72. Global ConfigAttribute viscmd_menu_attrib;
  73.  
  74. Global ConfigAttribute notifier_minimized_attrib;
  75. Global ConfigAttribute notifier_windowshade_attrib;
  76. Global ConfigAttribute notifier_always_attrib;
  77. Global ConfigAttribute notifier_never_attrib;
  78. Global ConfigAttribute notifier_fadeintime_attrib;
  79. Global ConfigAttribute notifier_fadeouttime_attrib;
  80. Global ConfigAttribute notifier_holdtime_attrib;
  81. Global ConfigAttribute notifier_disablefullscreen_attrib;
  82.  
  83. Global ConfigAttribute songticker_scrolling_enabled_attrib;
  84. Global ConfigAttribute songticker_scrolling_disabled_attrib;
  85.  
  86. // -----------------------------------------------------------------------------------------------------------------
  87.  
  88. initAttribs() {
  89.  
  90.     // create the custom cfgpage for this session (if it does exist, it just returns it)
  91.     ConfigItem custom_page = Config.newItem("Winamp Modern", CUSTOM_PAGE);
  92.     ConfigItem custom_page_drawer = Config.newItem("Drawers", CUSTOM_PAGE_DRAWER);
  93.     ConfigItem custom_page_menubars = Config.newItem("Menus", CUSTOM_PAGE_MENUBARS);
  94.     ConfigItem custom_page_windowshade = Config.newItem("Main Windowshade Mode", CUSTOM_PAGE_WINDOWSHADE);
  95.     ConfigItem custom_page_viscmd = Config.newItem("Vis Buttons", CUSTOM_PAGE_VISCMD);
  96.     ConfigItem custom_page_notifier = Config.newItem("Notifications", CUSTOM_PAGE_NOTIFIER);
  97.     ConfigItem custom_page_songticker = Config.newItem("Songticker", CUSTOM_PAGE_SONGTICKER);
  98.  
  99.     ConfigItem custom_page_nonexposed = Config.newItem("Hidden", CUSTOM_PAGE_NONEXPOSED);
  100.  
  101.     // load up the cfgpage in which we'll insert our custom page
  102.     ConfigItem custom_options_page = Config.getItem(CUSTOM_OPTIONSMENU_ITEMS);
  103.     ConfigItem custom_windows_page = Config.getItem(CUSTOM_WINDOWSMENU_ITEMS);
  104.  
  105.     // this creates a submenu for this attribute
  106.     ConfigAttribute submenuattrib = custom_options_page.newAttribute("Winamp Modern", "");
  107.     submenuattrib.setData(CUSTOM_PAGE); // discard any default value and point at our custom cfgpage
  108.  
  109.     ConfigAttribute drawersubmenu = custom_page.newAttribute("Drawers", "");
  110.     drawersubmenu.setData(CUSTOM_PAGE_DRAWER);
  111.  
  112.     ConfigAttribute menubarssubmenu = custom_page.newAttribute("Menus", "");
  113.     menubarssubmenu.setData(CUSTOM_PAGE_MENUBARS);
  114.  
  115.     ConfigAttribute windowshadesubmenu = custom_page.newAttribute("Main Windowshade Mode", "");
  116.     windowshadesubmenu.setData(CUSTOM_PAGE_WINDOWSHADE);
  117.  
  118.     ConfigAttribute viscmdsubmenu = custom_page.newAttribute("Vis Shortcut Button", "");
  119.     viscmdsubmenu.setData(CUSTOM_PAGE_VISCMD);
  120.  
  121.     ConfigAttribute notifiersubmenu = custom_page.newAttribute("Notifications", "");
  122.     notifiersubmenu.setData(CUSTOM_PAGE_NOTIFIER);
  123.  
  124.     ConfigAttribute songtickersubmenu = custom_page.newAttribute("Songticker", "");
  125.     songtickersubmenu.setData(CUSTOM_PAGE_SONGTICKER);
  126.  
  127.  
  128.     scrolldrawerattrib = custom_page_drawer.newAttribute("Animate Video/Vis Drawer (disabled if opacity < 100%)", "0");
  129.     scrollconfigdrawerattrib = custom_page_drawer.newAttribute("Animate Config Drawer", "0");
  130.     ConfigAttribute sep = custom_page_drawer.newAttribute("sep1", ""); sep.setData("-");
  131.     drawer_directiontop_attrib = custom_page_drawer.newAttribute("Open Video/Vis from the top", "0");
  132.     drawer_directionbottom_attrib = custom_page_drawer.newAttribute("Open Video/Vis from the bottom", "1");
  133.     drawer_directionbypass_attrib = custom_page_drawer.newAttribute("Bypass setting to keep in screen", "1");
  134.     if (drawer_directiontop_attrib.getData() == "1") drawer_directiontop_attrib.onDataChanged(); else drawer_directionbottom_attrib.onDataChanged();
  135.  
  136.     menubar_main_attrib = custom_page_menubars.newAttribute("Show Menus in Main Window", "1");
  137.     menubar_pe_attrib = custom_page_menubars.newAttribute("Show Menus in Playlist Editor", "1");
  138.     menubar_ml_attrib = custom_page_menubars.newAttribute("Show Menus in Media Library", "1");
  139.  
  140.     // create an attribute for each of our options, if the attribute already exists, it is returned
  141.     sep = custom_page.newAttribute("sep1", ""); sep.setData("-");
  142.     vis_detach_attrib = custom_page.newAttribute("Detach Vis Window", "0");
  143.     video_detach_attrib = custom_page.newAttribute("Detach Video Window", "0");
  144.     eq_visible_attrib = custom_windows_page.newAttribute("Equalizer\tAlt+G", "0");
  145.  
  146.     sep = custom_page.newAttribute("sep2", ""); sep.setData("-");
  147.     beatvisualization_attrib = custom_page.newAttribute("Enable Beat Visualization", "1");
  148.  
  149.     windowshade_linkall_attrib = custom_page_windowshade.newAttribute("Link Position and Width", "1");
  150.     windowshade_linkposition_attrib = custom_page_windowshade.newAttribute("Link Position, Unlink Width", "0");
  151.     windowshade_linknone_attrib = custom_page_windowshade.newAttribute("Unlink Position and Width", "0");
  152.  
  153.     viscmd_menu_attrib = custom_page_viscmd.newAttribute("Open Context Menu", "1");
  154.     viscmd_config_attrib = custom_page_viscmd.newAttribute("Open Configuration", "0");
  155.  
  156.     notifier_always_attrib = custom_page_notifier.newAttribute("Show always", "0");
  157.     notifier_windowshade_attrib = custom_page_notifier.newAttribute("Show with windowshade and when minimized", "0");
  158.     notifier_minimized_attrib = custom_page_notifier.newAttribute("Show only when minimized", "0");
  159.     notifier_never_attrib = custom_page_notifier.newAttribute("Never show", "1");
  160.     sep = custom_page_notifier.newAttribute("sep1", ""); sep.setData("-");
  161.     notifier_disablefullscreen_attrib = custom_page_notifier.newAttribute("Disable in fullscreen", "1");
  162.  
  163.     notifier_fadeintime_attrib = custom_page_nonexposed.newAttribute("Notifications fade in time", "1000");
  164.     notifier_fadeouttime_attrib = custom_page_nonexposed.newAttribute("Notifications fade out time", "5000");
  165.     notifier_holdtime_attrib = custom_page_nonexposed.newAttribute("Notifications display time", "2000");
  166.  
  167.     songticker_scrolling_enabled_attrib = custom_page_songticker.newAttribute("Enable Songticker scrolling", "1");
  168.     songticker_scrolling_disabled_attrib = custom_page_songticker.newAttribute("Disable Songticker scrolling", "0");
  169.  
  170. }
  171.  
  172. // -----------------------------------------------------------------------------------------------------------------
  173.  
  174. #ifdef MAIN_ATTRIBS_MGR
  175.  
  176. Global Int attribs_mychange;
  177.  
  178. #define NOOFF if (getData()=="0") { setData("1"); return; }
  179.  
  180. drawer_directiontop_attrib.onDataChanged() {
  181.   if (attribs_mychange) return;
  182.   NOOFF
  183.   attribs_mychange = 1;
  184.   drawer_directionbottom_attrib.setData("0");
  185.   drawer_directiontop_attrib.setData("1");
  186.   attribs_mychange = 0;
  187. }
  188.  
  189. drawer_directionbottom_attrib.onDataChanged() {
  190.   if (attribs_mychange) return;
  191.   NOOFF
  192.   attribs_mychange = 1;
  193.   drawer_directiontop_attrib.setData("0");
  194.   drawer_directionbottom_attrib.setData("1");
  195.   attribs_mychange = 0;
  196. }
  197.  
  198. windowshade_linkall_attrib.onDataChanged() {
  199.   if (attribs_mychange) return;
  200.   NOOFF
  201.   attribs_mychange = 1;
  202.   windowshade_linkposition_attrib.setData("0");
  203.   windowshade_linknone_attrib.setData("0");
  204.   attribs_mychange = 0;
  205. }
  206.  
  207. windowshade_linkposition_attrib.onDataChanged() {
  208.   if (attribs_mychange) return;
  209.   NOOFF
  210.   attribs_mychange = 1;
  211.   windowshade_linkall_attrib.setData("0");
  212.   windowshade_linknone_attrib.setData("0");
  213.   attribs_mychange = 0;
  214. }
  215.  
  216. windowshade_linknone_attrib.onDataChanged() {
  217.   if (attribs_mychange) return;
  218.   NOOFF
  219.   attribs_mychange = 1;
  220.   windowshade_linkall_attrib.setData("0");
  221.   windowshade_linkposition_attrib.setData("0");
  222.   attribs_mychange = 0;
  223. }
  224.  
  225. viscmd_menu_attrib.onDataChanged() {
  226.   if (attribs_mychange) return;
  227.   NOOFF
  228.   attribs_mychange = 1;
  229.   viscmd_config_attrib.setData("0");
  230.   attribs_mychange = 0;
  231.   updateVisCmd();
  232. }
  233.  
  234. viscmd_config_attrib.onDataChanged() {
  235.   if (attribs_mychange) return;
  236.   NOOFF
  237.   attribs_mychange = 1;
  238.   viscmd_menu_attrib.setData("0");
  239.   attribs_mychange = 0;
  240.   updateVisCmd();
  241. }
  242.  
  243. notifier_always_attrib.onDataChanged() {
  244.   if (attribs_mychange) return;
  245.   NOOFF
  246.   attribs_mychange = 1;
  247.   notifier_never_attrib.setData("0");
  248.   notifier_windowshade_attrib.setData("0");
  249.   notifier_minimized_attrib.setData("0");
  250.   attribs_mychange = 0;
  251. }
  252.  
  253. notifier_never_attrib.onDataChanged() {
  254.   if (attribs_mychange) return;
  255.   NOOFF
  256.   attribs_mychange = 1;
  257.   notifier_always_attrib.setData("0");
  258.   notifier_windowshade_attrib.setData("0");
  259.   notifier_minimized_attrib.setData("0");
  260.   attribs_mychange = 0;
  261. }
  262.  
  263. notifier_minimized_attrib.onDataChanged() {
  264.   if (attribs_mychange) return;
  265.   NOOFF
  266.   attribs_mychange = 1;
  267.   notifier_never_attrib.setData("0");
  268.   notifier_windowshade_attrib.setData("0");
  269.   notifier_always_attrib.setData("0");
  270.   attribs_mychange = 0;
  271. }
  272.  
  273. notifier_windowshade_attrib.onDataChanged() {
  274.   if (attribs_mychange) return;
  275.   NOOFF
  276.   attribs_mychange = 1;
  277.   notifier_never_attrib.setData("0");
  278.   notifier_always_attrib.setData("0");
  279.   notifier_minimized_attrib.setData("0");
  280.   attribs_mychange = 0;
  281. }
  282.  
  283. songticker_scrolling_enabled_attrib.onDataChanged() {
  284.   if (attribs_mychange) return;
  285.   NOOFF
  286.   attribs_mychange = 1;
  287.   songticker_scrolling_disabled_attrib.setData("0");
  288.   attribs_mychange = 0;
  289. }
  290. songticker_scrolling_disabled_attrib.onDataChanged() {
  291.   if (attribs_mychange) return;
  292.   NOOFF
  293.   attribs_mychange = 1;
  294.   songticker_scrolling_enabled_attrib.setData("0");
  295.   attribs_mychange = 0;
  296. }
  297.  
  298. #endif
  299.  
  300. #endif
  301.